#!/usr/bin/python3
import urllib.request
import urllib.parse
import sys
if __name__=='__main__':
    if len(sys.argv[1])==0:
        exit(1)
    p1 = urllib.parse.urlencode({'wd':sys.argv[1]})
    url1 = 'http://dict.baidu.com/s?%s' % p1
    opener = urllib.request.build_opener()
    opener.addheaders = [('User-agent', 'Mozilla/5.0')]
    fp1 = opener.open(url1)
    s = fp1.read().decode('utf-8')
    print(s)
    #print( url1 )
    
